
const HtmlWebpackPlugin = require('html-webpack-plugin');
const VueLoaderPlugin = require('vue-loader/lib/plugin');
module.exports  = {
    mode:'development',
    devtool:false,
    entry:'./src/main.js',
    resolve:{//配置解析的规则 
        alias:{//配置别名
            //require.resolve可以返回node_modules下的路径 
            vue:require.resolve('vue/dist/vue.esm.js')
        }
    },
    module:{
        rules:[
            {
                test:/\.vue$/,
                use:[
                    {
                        loader:'vue-loader'
                    }
                ]
            },
            {
                test:/\.css$/,
                use:[
                    {
                        loader:'style-loader'
                    },
                    {
                        loader:'css-loader'
                    }
                ]
            }
        ]
    },
    plugins:[
        new HtmlWebpackPlugin({
            template:'./src/index.html'
        }),
        new VueLoaderPlugin()
    ]
}